package com.casstime.ec.cloud.meeting.model;

import com.casstime.ec.cloud.meeting.dao.entity.EntityDevice;
import com.casstime.ec.cloud.meeting.values.EquipDTO;
import com.casstime.ec.cloud.stastic.transform.CommonTransform;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 查询结果设备信息封装对象
 * @author 罗茜
 */
@Data
public class Device {

  @ApiModelProperty(value="设备id")
  private Integer id;

  @ApiModelProperty(value="会议室id")
  private Integer roomId;

  @ApiModelProperty(value="设备名称")
  private String name;

  @ApiModelProperty(value="设备状态")
  private Integer state;

  @ApiModelProperty(value="设备数量")
  private Integer count;


  public EquipDTO toDTO() {
    return CommonTransform.transform(this,EquipDTO.class);
  }

  public static Device get(EntityDevice entityDevice) {
    Device device = new Device();
    if(entityDevice == null) {
       return null;
    }
    device.setId(entityDevice.getId());
    device.setRoomId(entityDevice.getRoomId());
    device.setName(entityDevice.getName());
    device.setState(entityDevice.getState());
    device.setCount(entityDevice.getCount());
    return device;
  }


}
